<%--
  Created by IntelliJ IDEA.
  User: Doris丶Lee
  Date: 2020-05-19
  Time: 07:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.*" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <%--basePath有什么用呢--%>
    <base href="<%=basePath%>">
    <title>jsp:useBean例子</title>
</head>
<body>
    <%--id是识别javabean的标识符;class指定使用的java的;默认是page，可以不写--%>
    <jsp:useBean id="myUser" class="com.po.User" scope="page"/>
    <h1>使用useBean动作创建javabean的实例</h1>
    <hr>
    <%--字符串默认类型是null--%>
    用户名：<%=myUser.getUsername() %><br>
    密码：<%=myUser.getPassword() %><br>
</body>
</html>
